#! /usr/bin/env bash

EXIT_VAL=0

if test -n "$1" && test "$1" -gt 0
then
  SEQ_COUNT=$1
else
  SEQ_COUNT=1000
fi

for i in $(seq 0 $SEQ_COUNT)
do
  if ! wtr.watcher . -ms 1
  then
    echo "i = $i" >> /tmp/wtr.watcher.fails
    EXIT_VAL=$((EXIT_VAL + 1))
  fi
done

exit $EXIT_VAL
